package com.such.kit.database.bean;

import java.sql.DatabaseMetaData;
import java.util.ArrayList;
import java.util.List;
import com.such.kit.database.support.JdbcResultSetMapping;

/**
 * @author SUCH
 * <pre>
 * 数据库表元数据
 * 
 * [参考 {@link DatabaseMetaData#getTables(String, String, String, String[])}]
 * </pre>
 */
public class DatabaseTable {

	public static final String TYPE_TABLE = "TABLE";
	public static final String TYPE_VIEW = "VIEW";
	public static final String TYPE_SYSTEM_TABLE = "SYSTEM TABLE";
	public static final String TYPE_GLOBAL_TEMPORARY = "GLOBAL TEMPORARY";
	public static final String TYPE_LOCAL_TEMPORARY = "LOCAL TEMPORARY";
	public static final String TYPE_ALIAS = "ALIAS";
	public static final String TYPE_SYSNONYM = "SYSNONYM";
	public static final String REF_GENERATION_SYSTEM = "SYSTEM";
	public static final String REF_GENERATION_USER = "USER";
	public static final String REF_GENERATION_DERIVED = "DERIVED";
	/** INFO_COLUMN：对应表中列扩展信息 */
	public static final String INFO_COLUMN = "COLUMN";
	/** INFO_PRIMARY_KEY：对应表中主键扩展信息 */
	public static final String INFO_PRIMARY_KEY = "PRIMARY_KEY";
	/** INFO_FOREIGN_KEY：对应表中外键扩展信息 */
	public static final String INFO_FOREIGN_KEY = "FOREIGN_KEY";
	/** INFO_INDEX：对应表中索引扩展信息 */
	public static final String INFO_INDEX = "INDEX";

	/** catalog：（TABLE_CAT）表所在编目 */
	@JdbcResultSetMapping("TABLE_CAT")
	private String catalog;
	/** schema：（TABLE_SCHEM）表所在模式 */
	@JdbcResultSetMapping("TABLE_SCHEM")
	private String schema;
	/** name：（TABLE_NAME）表名 */
	@JdbcResultSetMapping("TABLE_NAME")
	private String name;
	/** type：（TABLE_TYPE）表类型 [参照 TYPE_*] */
	@JdbcResultSetMapping("TABLE_TYPE")
	private String type;
	/** comment：（REMARKS）表备注 */
	@JdbcResultSetMapping("REMARKS")
	private String comment;
	/** catalogType：（TYPE_CAT）编目类型 */
	@JdbcResultSetMapping("TYPE_CAT")
	private String catalogType;
	/** schemaType：（TYPE_SCHEM）模式类型 */
	@JdbcResultSetMapping("TYPE_SCHEM")
	private String schemaType;
	/** nameType：（TYPE_NAME）表名类型 */
	@JdbcResultSetMapping("TYPE_NAME")
	private String nameType;
	/** nameType：（SELF_REFERENCING_COL_NAME）name of the designated "identifier" column of a typed table */
	@JdbcResultSetMapping("SELF_REFERENCING_COL_NAME")
	private String selfReferencingColName;
	/** refGeneration：（REF_GENERATION）specifies how values in SELF_REFERENCING_COL_NAME are created [参照 REF_GENERATION_*] */
	@JdbcResultSetMapping("REF_GENERATION")
	private String refGeneration;

	/** columns：列扩展信息 */
	private List<DatabaseColumn> columns = new ArrayList<DatabaseColumn>();
	/** primaryKeys：主键扩展信息 */
	private List<DatabasePrimaryKey> primaryKeys = new ArrayList<DatabasePrimaryKey>();
	/** primaryKeys：外键扩展信息 */
	private List<DatabaseForeignKey> foreignKeys = new ArrayList<DatabaseForeignKey>();
	/** primaryKeys：索引扩展信息 */
	private List<DatabaseIndex> indexs = new ArrayList<DatabaseIndex>();

	/** [参考 {@link #catalog}] */
	public String getCatalog() {
		return this.catalog;
	}

	/** [参考 {@link #catalog}] */
	public void setCatalog(String catalog) {
		this.catalog = catalog;
	}

	/** [参考 {@link #schema}] */
	public String getSchema() {
		return this.schema;
	}

	/** [参考 {@link #schema}] */
	public void setSchema(String schema) {
		this.schema = schema;
	}

	/** [参考 {@link #name}] */
	public String getName() {
		return this.name;
	}

	/** [参考 {@link #name}] */
	public void setName(String name) {
		this.name = name;
	}

	/** [参考 {@link #type}] */
	public String getType() {
		return this.type;
	}

	/** [参考 {@link #type}] */
	public void setType(String type) {
		this.type = type;
	}

	/** [参考 {@link #comment}] */
	public String getComment() {
		return this.comment;
	}

	/** [参考 {@link #comment}] */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/** [参考 {@link #catalogType}] */
	public String getCatalogType() {
		return this.catalogType;
	}

	/** [参考 {@link #catalogType}] */
	public void setCatalogType(String catalogType) {
		this.catalogType = catalogType;
	}

	/** [参考 {@link #schemaType}] */
	public String getSchemaType() {
		return this.schemaType;
	}

	/** [参考 {@link #schemaType}] */
	public void setSchemaType(String schemaType) {
		this.schemaType = schemaType;
	}

	/** [参考 {@link #nameType}] */
	public String getNameType() {
		return this.nameType;
	}

	/** [参考 {@link #nameType}] */
	public void setNameType(String nameType) {
		this.nameType = nameType;
	}

	/** [参考 {@link #selfReferencingColName}] */
	public String getSelfReferencingColName() {
		return this.selfReferencingColName;
	}

	/** [参考 {@link #selfReferencingColName}] */
	public void setSelfReferencingColName(String selfReferencingColName) {
		this.selfReferencingColName = selfReferencingColName;
	}

	/** [参考 {@link #refGeneration}] */
	public String getRefGeneration() {
		return this.refGeneration;
	}

	/** [参考 {@link #refGeneration}] */
	public void setRefGeneration(String refGeneration) {
		this.refGeneration = refGeneration;
	}

	/** [参考 {@link #columns}] */
	public List<DatabaseColumn> getColumns() {
		return this.columns;
	}

	/** [参考 {@link #columns}] */
	public void setColumns(List<DatabaseColumn> columns) {
		this.columns = columns;
	}

	/** [参考 {@link #primaryKeys}] */
	public List<DatabasePrimaryKey> getPrimaryKeys() {
		return this.primaryKeys;
	}

	/** [参考 {@link #primaryKeys}] */
	public void setPrimaryKeys(List<DatabasePrimaryKey> primaryKeys) {
		this.primaryKeys = primaryKeys;
	}

	/** [参考 {@link #foreignKeys}] */
	public List<DatabaseForeignKey> getForeignKeys() {
		return this.foreignKeys;
	}

	/** [参考 {@link #foreignKeys}] */
	public void setForeignKeys(List<DatabaseForeignKey> foreignKeys) {
		this.foreignKeys = foreignKeys;
	}

	/** [参考 {@link #indexs}] */
	public List<DatabaseIndex> getIndexs() {
		return this.indexs;
	}

	/** [参考 {@link #indexs}] */
	public void setIndexs(List<DatabaseIndex> indexs) {
		this.indexs = indexs;
	}

}
